package com.xmut.mall.product.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xmut.mall.product.entity.SpuInfoEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmut.mall.product.searchparam.ManagerProductSearchParam;
import com.xmut.mall.product.searchparam.ProductReviewSearchParam;
import com.xmut.mall.product.searchparam.SpuSearchParam;
import com.xmut.mall.product.vo.ManagerProductPageVo;
import com.xmut.mall.product.vo.ProductReviewVo;
import com.xmut.mall.product.vo.SpuPageVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * spu信息
 *
 * @author 1912120131suntingxing
 * @email 1192081604@qq.com
 * @date 2022-07-14 00:45:33
 */
@Mapper
public interface SpuInfoDao extends BaseMapper<SpuInfoEntity> {

    /**
     * 修改当前spu的状态为上架
     *
     * @param spuId
     * @param code
     */
    void updateSpuStatus(@Param("spuId") Long spuId, @Param("code") int code);

    /**
     * 获取商品审核分页数据
     *
     * @param initPage
     * @param param
     * @return
     */
    IPage<ProductReviewVo> getProductReviewByPage(Page<Object> initPage, @Param("param") ProductReviewSearchParam param);

    /**
     * 获取spu的分页信息
     *
     * @param initPage
     * @param param
     * @return
     */
    IPage<SpuPageVo> getSpuByPage(Page<Object> initPage, @Param("param") SpuSearchParam param);

    /**
     * 获取官方管理端的Spu分页数据
     * @param initPage
     * @param param
     * @return
     */
    IPage<ManagerProductPageVo> getManagerSpuPage(Page<Object> initPage,@Param("param") ManagerProductSearchParam param);
}
